<?PHP
include_once "ini.php";
include "url.php";
dbconnect();

$sql = "SELECT * FROM users WHERE online = '1';";
$req = mysql_query($sql);
echo $sql, "\r\n";
if (!$req)
{
    echo "SQL error : ", $sql;
    exit ;
}
else
{
    $file = "../camPosition.txt";
    $fp = fopen($file, "w");

    while ($tab = mysql_fetch_assoc($req))
    {
		print_r($tab);
        $ligne = $tab['id_user']."	".$tab['latitude'].",".$tab['longitude'].",".$tab['altitude']."	".$tab['orientation_dir']."	".$tab['orientation_up']."	url	".$tab['nom_user']."\n";
        fputs($fp, $ligne);
    }
    fclose($fp);
}

dbclose();

?>
